import {$post, $get, $delete, $put} from './../lanb/api/requests'

// 模块
export function getModuleInfs (data) {
  return $get('/api/code/moduleInf', data)
}

export function saveModuleInf (data) {
  return $post('/api/code/moduleInf', data)
}

export function deleteModuleInf (data) {
  const id = data.moduleId
  return $delete('/api/code/moduleInf/' + id)
}

export function updateModuleInf (data) {
  const id = data.moduleId
  return $put('/api/code/moduleInf/' + id, data)
}

// 数据表
export function getTableInfs (data) {
  return $get('/api/code/tableInf', data)
}

export function saveTableInf (data) {
  return $post('/api/code/tableInf', data)
}

export function deleteTableInf (data) {
  const id = data.tableId
  return $delete('/api/code/tableInf/' + id)
}

export function updateTableInf (data) {
  const id = data.tableId
  return $put('/api/code/tableInf/' + id, data)
}

export function saveTableInfByModuleId (moduleId, data) {
  return $post('/api/code/tableInf/' + moduleId, data)
}
